package com.smashcrush.client.gwt.service;

import com.google.code.jsonrpc.client.JsonRemoteService;
import com.google.code.jsonrpc.client.POST;
import com.google.code.jsonrpc.client.Path;
import com.google.code.jsonrpc.client.PathParam;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * The client side stub for the RPC service.
 */
public interface UserServiceAsync extends JsonRemoteService {

	public static class RPC {
		public static UserServiceAsync get() {
			UserServiceAsync ourInstance = GWT.create(UserServiceAsync.class);
			return ourInstance;
		}
	}

	@POST
	@Path("/api/user/login/{emailAddress}/{password}")
	void login(@PathParam("emailAddress") String emailAddress,
			@PathParam("password") String password,
			AsyncCallback<String> callback);

	// @POST
	// @Path("/api/user/logout")
	// void logout(AsyncCallback callback);

	@POST
	@Path("/api/user/register/{emailAddress}/{password}")
	void register(@PathParam("emailAddress") String emailAddress,
			@PathParam("password") String password,
			AsyncCallback<String> callback);

}
